#pragma once

#include "RBTree.h"

namespace m_std
{
    template <class K>
    class set
    {
        struct setOfValue
        {
            const K &operator()(const K &data)
            {
                return data;
            }
        };
    public:
        typedef typename RBTree<K, K, setOfValue>::iterator iterator;

        iterator begin()
        {
            return _t.begin();
        }
        iterator end()
        {
            return _t.end();
        }
        pair<iterator, bool> insert(const K &key)
        {
            return _t.insert(key);
        }

    private:
        RBTree<K, K, setOfValue> _t;
    };
    void setTest()
    {
        set<int> s;
        s.insert(5);
        s.insert(4);
        s.insert(7);
        s.insert(1);
        set<int>::iterator it = s.begin();
        while (it != s.end())
        {
            cout << *it << endl;
            ++it;
        }
    }
};